import axios from 'axios';

const url = '/adminapi/file/';

export interface QueryParams extends Partial<any> {
  page: number;
  limit: number;
}

/**
 * 列表
 */
export function apiList(params?: any) {
  return axios.get<any>(`${url}list`, { params });
}

/**
 * 详情
 */
export function apiInfo(params: any) {
  return axios.get(`${url}info`, { params });
}

/**
 * 保存
 */
export function apiSave(data: any) {
  return axios.post(`${url}save`, data);
}

/**
 * 删除
 */
export function apiDel(params: any) {
  return axios.get(`${url}delete`, { params });
}

/**
 * 启用/禁用
 */
export function apiDisable(params: any) {
  return axios.get(`${url}handle`, { params });
}
